package com.baizhi.hospital.controller;


import com.baizhi.hospital.annotation.LogAnnotation;
import com.baizhi.hospital.entity.Triage;
import com.baizhi.hospital.entity.User;
import com.baizhi.hospital.service.TriageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.Map;

@RestController
public class TriageController {
	@Autowired
	private TriageService triageService;


	/**
	 *
	 * @param triage 接收数据的对象
	 * @return 将结果以json的结果返回
	 */
	@RequestMapping("/addTriage")
	@LogAnnotation(value = "添加分诊信息",type = 2)
	public Map addTriage(Triage triage){
//		从session中获取当前登陆的医生的id
		Map map = triageService.addTriage(triage);
		return map;
	}


	@RequestMapping("/selectTriageInfo")
	@LogAnnotation(value = "查看所有的分诊记录",type = 2)
	public Map selectTriageInfo(int page,int limit,int departmentId){
		return triageService.selectTriageInfo(page,limit,departmentId);
	}



	@RequestMapping("/updateTriage")
	@LogAnnotation(value = "诊断",type = 2)
	public Map updateTriage(Triage triage,String dtoPatientName){
		System.out.println(123+dtoPatientName);
		return triageService.updateTriage(triage);

	}


}
